<script setup>
import { RouterView, useRoute } from 'vue-router'
import { computed } from 'vue'

const route = useRoute()

// 检查是否是聊天相关页面，如果是则隐藏导航
const isChatPage = computed(() => {
  return route.path === '/chat'
})
</script>

<template>
  <!-- 只在非聊天页面显示导航 -->
  <div v-if="!isChatPage" class="nav-container">
    <nav class="main-nav">
      <div class="nav-brand">
        <h2>科技AI智能体</h2>
      </div>
      <div class="nav-links">
        <RouterLink to="/" class="nav-link">首页</RouterLink>
        <RouterLink to="/chat" class="nav-link">智能助手</RouterLink>
      </div>
    </nav>
  </div>

  <RouterView />
</template>

<style scoped>
.nav-container {
  background: linear-gradient(135deg, #0a1a2a 0%, #1e3c5a 100%);
  color: white;
  padding: 0;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-brand h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, #00d4aa, #4dabf7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.router-link-active {
  color: #00d4aa;
  background: rgba(0, 212, 170, 0.1);
}

@media (max-width: 768px) {
  .main-nav {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .nav-brand h2 {
    font-size: 1.25rem;
  }
}
</style>
